//
//  BDNewFriendTableViewCell.m
//  BadBoy
//
//  Created by wen on 2017/4/13.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDNewFriendTableViewCell.h"

@interface BDNewFriendTableViewCell ()

@property (nonatomic, strong) UIView *topLine;
@property (nonatomic, strong) UIView *bottomLine;

@end

@implementation BDNewFriendTableViewCell

- (void)layoutSubviews{
    self.imageView.size = CGSizeMake(self.height - 20, self.height - 20);
    self.imageView.left = 10;
    self.imageView.centerY = self.height / 2.0;
    self.imageView.layer.masksToBounds = YES;
    self.imageView.layer.cornerRadius = self.imageView.width / 2.0;
    
    self.textLabel.font = [UIFont systemFontOfSize:15];
    self.textLabel.textColor = [UIColor colorWithHexString:@"#1c1c1c"];
    [self.textLabel sizeToFit];
    self.textLabel.left = self.imageView.right + 10;
    self.textLabel.centerY = self.imageView.centerY;
    
    self.topLine.frame = CGRectMake(0, 0, self.width, 0.5);
    self.topLine.backgroundColor = kBDColorGray;
    self.bottomLine.frame = CGRectMake(0, 0, self.width, 0.5);
    self.bottomLine.bottom = self.height;
    self.bottomLine.backgroundColor = kBDColorGray;
    
    if (self.isFirst == YES) {
        self.topLine.hidden = NO;
    }else{
        self.topLine.hidden = YES;
    }
}

- (UIView *)topLine{
    if (!_topLine) {
        self.topLine = [[UIView alloc] init];
        [self.contentView addSubview:_topLine];
    }
    return _topLine;
}

- (UIView *)bottomLine{
    if (!_bottomLine) {
        self.bottomLine = [[UIView alloc] init];
        [self.contentView addSubview:_bottomLine];
    }
    return _bottomLine;
}
@end
